/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-04 16:16:43
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-04 16:19:39
 * @Description: file content
 */

#include "apue.h"

int main()
{
    char *ptr = NULL;
    size_t size = 0;

    if (chdir("/tmp") < 0)
    {
        err_sys("chdir failed");
    }

    ptr = path_alloc(&size);
    if (NULL == getcwd(ptr, size))
    {
        err_sys("getcwd failed");
    }

    printf("cwd = %s\n", ptr);
    exit(0);
}
